<?php
/*
This template displays Flickr photos based on a tag
*/
global $SilasFlickrPlugin;
?>

<?php include($SilasFlickrPlugin->getDisplayTemplate('photoalbum-nav.html'));?>

<h2>Tag: <?php echo htmlentities($request['tags'])?></h2>
<?php
?>

<div id="photos">

<?php 
$tpl = $SilasFlickrPlugin->getDisplayTemplate('photoalbum-photo-link.html');
foreach ($photos as $photo):?>
    <a <?php if ($SilasFlickrPlugin->config['useLightbox']):?>
        rel="lightbox[album]" href="<?php echo $photo['sizes']['Medium']['source']?>"
        <?php else:?>
        href="photo/<?php echo $photo['id']?>/<?php echo $album['pagename2'] . '-' .$photo['pagename']?>"
        <?php endif;?>
        id="photo-<?php echo $photo['id']?>"
        title="<?php echo htmlentities($photo['title'])?>"><img src="<?php echo $photo['sizes']['Square']['source']?>" width="<?php echo $photo['sizes']['Square']['width']?>" height="<?php echo $photo['sizes']['Square']['height']?>" 
        alt="<?php echo htmlentities($photo['title'])?>" /></a>
<?php endforeach?>
</div>
<div class="flickr-meta-links">
<a href="http://www.flickr.com/photos/tags/<?php echo urlencode($request['tags']);?>/" target="_blank">View this tag on Flickr</a>
</div>
